<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        a {
            clear: both;
            display: block;
            width: 100%;
            height: 20px;
        }

        .box {
            width: 250px;
            height: 250px;
            float: left;
            background-color: blanchedalmond;
            margin: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            box-sizing: border-box;
            padding: 30px;
            position: relative;
        }

        .gradient1 {
            /*最重要的部分如下：*/
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-position: 125px;
        }


        .gradient3 {
            /*最重要的部分如下：*/
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            /* 使用vh或vw单位，另类的百分比，适应性不是很好 */
            background-position: 32.6vw;
        }

        .gradient2 {
            width: 250px;
            height: 100px;
            position: absolute;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #FFFFFF;
            /*最重要的部分如下：*/
            background: radial-gradient(circle at 0 50%, #fff 16px, transparent 16px) left top,
                radial-gradient(circle at 100% 50%, #fff 16px, transparent 16px) right top;
            background-size: 51% 100%;
            background-repeat: no-repeat;
        }

        .gradient4 {
            /*最重要的部分如下：*/
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 100%;
            background-position: 4993% 0%;
        }

        .gradient5 {
            /*最重要的部分如下：*/
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 99%;
            background-position: 4993% 5005%;
        }

        .gradient6 {
            /*最重要的部分如下：*/
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 85.36%;
            background-position: 4993% 5005%;
        }

        .gradient7 {
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 31.36%;
            background-position: 4993% 5005%;
        }

        .gradient8 {
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 13.36%;
            background-position: 4993% 1005%;
        }

        .gradient9 {
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 99% 18.36%;
            background-position: 4993% 1005%;
        }

        .gradient10 {
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 25% 25.36%;
            background-position: 5300% 2001%;
        }

        .gradient11 {
            background-image: radial-gradient(circle at center, #fff 0%, #fff 18px, transparent 18px, transparent 100%);
            background-size: 100% 25.36%;
            background-position: 5300% 2001%;
        }

        .myConcave {
            position: absolute;
            width: 100%;
        }

        .myConcave::before {
            content: " ";
            border-bottom: 1px solid #528ee8;
            transform: scale(.5);
            position: absolute;
            left: 0;
            width: calc(100% - 60px);
            margin: 0 30px;
            z-index: 20;
        }

        .myConcave::after {
            position: absolute;
            content: " ";
            bottom: -27px;
            left: 0;
            height: 60px;
            width: 100%;
            background-image: radial-gradient(circle closest-side at center, #528ee8 0%, #528ee8 15px, transparent 15px, transparent 100%);
            background-size: 99% 100%;
            background-position: 4993% 4110%;
            z-index: 10;
        }
    </style>
</head>

<body>
    <a href="https://www.cnblogs.com/iPing9/p/13594372.html">background + gradient 使用技巧</a>

    <div class="box" style="flex-direction:column;">
        <!-- <div class="">使用一个新的元素来作为分割</div> -->
        <div class="myConcave"></div>
    </div>
    <div class="box gradient1">使用了固定数值，适应性不是很好</div>
    <div class="box gradient3">使用了固定数值，适应性不是很好</div>
    <div class="box ">
        <div class="gradient2">左右内凹圆形3</div>
    </div>
    <div class="box gradient4"></div>
    <div class="box gradient5"></div>
    <div class="box gradient6"></div>
    <div class="box gradient7"></div>
    <div class="box gradient8"></div>
    <div class="box gradient9"></div>
    <div class="box gradient10"></div>
    <div class="box gradient11"></div>


    <script>
        var number = 1005;
        setInterval(() => {
            var gradient9 = document.getElementsByClassName("gradient9")
            number -= 2
            gradient9[0].style.backgroundPosition = "4993% " + (number) + "%"
            if (number < 0) number = 1005
        }, 50);

        var number2 = 100;
        var tap = -1;
        setInterval(() => {
            document.querySelector(".gradient11").style.backgroundSize = (number2 = number2 + tap) + '% 25.36%'
            if (number2 < 1) tap = 1
            if (number2 > 100) tap = -1
        }, 100);
    </script>
</body>

</html>